import Types from '../types';
import DataStore from '../../public/dao/DataStore';
import {handleData} from '../ActionUtil'
export function getCreditCardList(storeName,data){
    return dispatch =>{
        dispatch({type: Types.CREDIT_CARD_DATA_LIST_REFRSH, storeName: storeName});
        let dataStore = new DataStore();
        dataStore.fetchData('/webservice/loan',data,'POST',`CreditCardData${data.category}`).then((json)=>{
            handleData(Types.CREDIT_CARD_DATA_LIST_SUCCESS,dispatch,storeName,json,'creditcard');
        }).catch((err)=>{
            dispatch({
                type:Types.CREDIT_CARD_DATA_LIST_FAIL,
                storeName,
                err
            })
        })
    }
}